var e = require;
var t = module;
var o = exports;
var n,
    i = o,
    a =
        ((n = function (e, t) {
            return (n =
                Object.setPrototypeOf ||
                ({__proto__: []} instanceof Array &&
                    function (e, t) {
                        e.__proto__ = t;
                    }) ||
                function (e, t) {
                    for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o]);
                })(e, t);
        }),
        function (e, t) {
            function o() {
                this.constructor = e;
            }
            n(e, t), (e.prototype = null === t ? Object.create(t) : ((o.prototype = t.prototype), new o()));
        }),
    r = function (e, t, o, n) {
        var i,
            a = arguments.length,
            r = a < 3 ? t : null === n ? (n = Object.getOwnPropertyDescriptor(t, o)) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, o, n);
        else
            for (var s = e.length - 1; s >= 0; s--)
                (i = e[s]) && (r = (a < 3 ? i(r) : a > 3 ? i(t, o, r) : i(t, o)) || r);
        return a > 3 && r && Object.defineProperty(t, o, r), r;
    };
Object.defineProperty(i, "__esModule", {value: !0});
var s = e("AssetsMap"),
    c = e("BundleNames"),
    l = e("GameData"),
    d = e("nodePoolManager"),
    u = e("SkinLevelData"),
    p = e("GameModuleView"),
    h = cc._decorator,
    f = h.ccclass,
    _ =
        (h.property,
        (function (e) {
            function t() {
                var t = (null !== e && e.apply(this, arguments)) || this;
                return (
                    (t._snakeName = ""),
                    (t._world_pos = null),
                    (t._vector = null),
                    (t._skin_index = 0),
                    (t.angle = 0),
                    t
                );
            }
            return (
                a(t, e),
                (t.prototype.init = function () {
                    var e, t;
                    this._snakeName == l.default.instance.UserName
                        ? ((e = "AttackRange_blue_size"), (t = "AttackRange_blue_icon"))
                        : ((e = "AttackRange_red_size"), (t = "AttackRange_red_icon"));
                    var o = game.BundleManager.instance
                            .getBundle(c.default.Game)
                            .get(s.default.GameBundle.textures.assetsList[e], cc.SpriteFrame),
                        n = game.BundleManager.instance
                            .getBundle(c.default.Game)
                            .get(s.default.GameBundle.textures.assetsList[t], cc.SpriteFrame),
                        i = this.node.getChildByName("bomb_target");
                    i.getChildByName("bg").getComponent(cc.Sprite).spriteFrame = o;
                    for (var a = 1; a < 5; a++)
                        i.getChildByName("direction" + a).getComponent(cc.Sprite).spriteFrame = n;
                    var r = u.SkinLevelData.instance.skinList[this._skin_index],
                        h = "";
                    h = r && null != r ? "bomb_" + r.name : "bomb_rabbit";
                    var f = this.node.getChildByName("bomb_sprite").getComponent(cc.Sprite),
                        _ = this.node.getChildByName("bomb_target");
                    s.default.GameBundle.textures.assetsList[h] || (h = "bomb_pirate");
                    var y = game.BundleManager.instance
                        .getBundle(c.default.Game)
                        .get(s.default.GameBundle.textures.assetsList[h], cc.SpriteFrame);
                    (f.spriteFrame = y), (null != y && y) || console.log(r.chinese + "的炸弹皮肤出错了。。。");
                    var m = this._world_pos;
                    f.node.setPosition(m.x, m.y);
                    var g = cc.v2(0, 0);
                    (g.x = m.x + 350 * this._vector.x),
                        (g.y = m.y + 350 * this._vector.y),
                        (_.x = m.x + 350 * this._vector.x),
                        (_.y = m.y + 350 * this._vector.y),
                        (_.angle = this.angle);
                    var v = game.BundleManager.instance
                            .getBundle(c.default.Game)
                            .get(s.default.GameBundle.textures.assetsList.blast1, cc.SpriteFrame),
                        w = game.BundleManager.instance
                            .getBundle(c.default.Game)
                            .get(s.default.GameBundle.textures.assetsList.blast2, cc.SpriteFrame),
                        b = game.BundleManager.instance
                            .getBundle(c.default.Game)
                            .get(s.default.GameBundle.textures.assetsList.blast3, cc.SpriteFrame),
                        C = game.BundleManager.instance
                            .getBundle(c.default.Game)
                            .get(s.default.GameBundle.textures.assetsList.blast4, cc.SpriteFrame),
                        k = game.BundleManager.instance
                            .getBundle(c.default.Game)
                            .get(s.default.GameBundle.textures.assetsList.blast5, cc.SpriteFrame),
                        N = this;
                    (this.node.active = !0),
                        cc
                            .tween(f.node)
                            .to(0.5, {position: cc.v3(g.x, g.y, 0), angle: 720})
                            .call(function () {
                                f.spriteFrame = v;
                                var e = _.convertToWorldSpaceAR(cc.Vec2.ZERO);
                                p.default.Insance._layer_snake.bomb_burst(e, N._snakeName);
                            })
                            .delay(0.1)
                            .call(function () {
                                f.spriteFrame = w;
                            })
                            .delay(0.1)
                            .call(function () {
                                f.spriteFrame = b;
                            })
                            .delay(0.1)
                            .call(function () {
                                f.spriteFrame = C;
                            })
                            .delay(0.1)
                            .call(function () {
                                f.spriteFrame = k;
                            })
                            .delay(0.1)
                            .call(function () {
                                p.default.Insance && d.default.instance.delBombNode(N.node);
                            })
                            .start();
                }),
                r([f], t)
            );
        })(cc.Component));
i.default = _;
